#!/bin/sh
DVDIR_ROOT='data/in/dataverses.root'
DVDIR_BIRDS='data/in/dataverses.birds'
DVDIR_TREES='data/in/dataverses.trees'
DSDIR='data/in/datasets'
FILESDIR='data/in/files'

#rm data/in/dataverses/1
for i in `ls $DVDIR_ROOT`; do
  curl -s -H "Content-type:application/json" -X POST -d @$DVDIR_ROOT/$i "http://localhost:8080/api/dataverses/root?key=$PETEKEY"
done

for i in `ls $DVDIR_BIRDS`; do
  curl -s -H "Content-type:application/json" -X POST -d @$DVDIR_BIRDS/$i "http://localhost:8080/api/dataverses/birds?key=$PETEKEY"
done

for i in `ls $DVDIR_TREES`; do
  curl -s -H "Content-type:application/json" -X POST -d @$DVDIR_TREES/$i "http://localhost:8080/api/dataverses/trees?key=$PETEKEY"
done

# 9 is "sparrows"
#curl -H "Content-type:application/json" -X POST -d @data/in/dataverses.misc/8 "http://localhost:8080/api/dataverses/9?key=pete"
#curl -H "Content-type:application/json" -X POST -d @data/in/dataverses.misc/9 "http://localhost:8080/api/dataverses/trees?key=pete"

#for i in `ls $DSDIR`; do
#  curl http://localhost:8080/api/datasets -H 'Content-type:application/json' --data-binary @$DSDIR/$i
#done

#for i in `ls $FILESDIR`; do
#  curl http://localhost:8080/api/files -H 'Content-type:application/json' --data-binary @$FILESDIR/$i
#done
